
package atm.utilities;

public class ValidationUtilities {

	private static String creditCardRegex = "[1-9]{4}-[1-9]{4}-[1-9]{4}-[1-9]{4}";

	private static String monthRegex = "1[0-2]|[1-9]";

	private static String yearRegex = "2[0-9]{3}";

	private static String pinRegex = "[0-9]{4}";

	public static boolean isCreditCardNumber(String text) {
		return text.matches(creditCardRegex);
	}

	public static boolean isMonth(int month) {
		return month > 0 && month < 13;
	}

	public static boolean isMonthNumber(String text) {
		return text.matches(monthRegex);
	}

	public static boolean isPinCode(String text) {
		return text.matches(pinRegex);
	}

	public static boolean isYear(int year) {
		return year > 1999 && year < 3000;
	}

	public static boolean isYearNumber(String text) {
		return text.matches(yearRegex);
	}
}
